<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <script src="/lib/jquery/1.9.1/jquery.js"></script>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <script src="/H-ui.admin/lib/layer/2.4/layer.js"></script>
    <script src="/icheck-1.x/icheck.js"></script>
    <link href="/icheck-1.x/skins/all.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Title</title>
</head>
<body>
<div class="container-fluid" style="margin: 20px 50px;width:80%;height: 80%">
    <form class="col-md-12"action="{:url('search')}" method="post">
        <div class="col-md-12">
            <div class="col-md-10">
                <div class="input-group">
                    <span class="input-group-addon">关键字(电话或商户名称)&emsp;</span>
                    <input type="text" class="form-control"  name="content" placeholder="">
                </div>
            </div>
            <button type="submit" class="btn btn-default col-sm-1"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>搜索</button>
        </div>
    </form>

</div>


<div style="margin: 10px 50px">
    <table class="table table-hover" style="width:100%">
        <tr>
            <th>&emsp;</th>
            <th>ID</th>
            <th>分类</th>
            <th>所在地</th>
            <th>商户名称</th>
            <th>电话</th>
        </tr>
        {foreach $items as $value}
        <tr>
            <td>
                <div style="margin-left: 25px">
                    <input type="radio" name="store" data-name="{$value.store_name}"/>
                </div>
            </td>
            <td>{$value.id}</td>
            <td>{$value.store_type}</td>
            <td>{$value.address}</td>
            <td>{$value.store_name}</td>
            <td>{$value.mobile}</td>
        </tr>
        {/foreach}
    </table>
    <div style="">{php}echo $page{/php}</div>
    <hr>
    <button type="button" class="btn btn-primary comfirm">确认选择</button>
</div>
<script>
    $("input:not('.make-switch')").iCheck({
        labelHover : false,
        cursor : true,
        checkboxClass : 'icheckbox_square-blue',
        radioClass : 'iradio_square-blue',
        increaseArea : '20%'
    });
    $(".comfirm").on("click",function (e) {
        var name=$("input[type='radio']:checked").data("name");
        parent.$("input[name='store']").val(name);
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.layer.close(index); //再执行关闭
    });
</script>
</body>
</html>